/**
 * 
 */
package edu.umd.clip.lm.util.tree;

import java.util.Iterator;
import edu.umd.clip.lm.util.*;
/**
 * @author Denis Filimonov <den@cs.umd.edu>
 *
 */
public abstract class BinaryTreeIterator<T extends XMLizable> implements Iterator<T> {
	protected BinaryTree<T> root;
	protected BinaryTree<T> current;
	
	protected BinaryTreeIterator(BinaryTree<T> root) {
		this.current = root;
		this.root = root;
	}

	/* (non-Javadoc)
	 * @see java.util.Iterator#remove()
	 */
	public void remove() {
		throw new UnsupportedOperationException("BinaryTreeIterator cannot delete elements");
	}

	public abstract BinaryTree<T> nextNode();

	@Override
	public T next() {
		return nextNode().getPayload();
	}
	
	
}
